export default {
    seachList(seachchange, page, pagesize) {
        let res = null;
        let Searchlist = []
        let totalList = {
            currentPage: null,
            pageSize: null,
            total: null,
            totalPage: null
        }
        res = window.api.pageFishbowl(JSON.stringify(seachchange), page, pagesize)

        // 当前页
        totalList.currentPage = res?.getPageSync()
        // 每页数量
        totalList.pageSize = res?.getPageSizeSync()
        // 总页数
        totalList.totalPage = res?.getTotalPageSync()
        // 总条数
        totalList.total = res?.getTotalSync()

        const size = res?.sizeSync()

        for (let i = 0; i < size; i++) {
            const result = res?.getSync(i)
            const id = result.getSync('id')
            const propertyValue = result.getSync('propertyValue')
            const createTime = result.getSync('createTime')


            let list = {
                id: id,
                propertyValue: JSON.parse(propertyValue),
                createTime: createTime

            }
            Searchlist.push(list)
        }
        return { totalList, Searchlist }
    }
}